#include <iostream>
#include <iomanip>
#include <cmath>

int main() {
    std::cout << "=== C++ 中的计算顺序对比 ===" << std::endl;
    
    double method1 = 6.0/80 * 100;      // 先除后乘
    double method2 = (6.0/80) * 100;    // 明确分组
    double val = 6.0/80;
    double method3 = val * 100;         // 分步计算
    
    std::cout << std::fixed << std::setprecision(17);
    std::cout << "6.0/80 * 100:    " << method1 << std::endl;
    std::cout << "(6.0/80) * 100:  " << method2 << std::endl;
    std::cout << "val * 100:       " << method3 << std::endl;
    
    std::cout << "\nround 结果:" << std::endl;
    std::cout << "round(method1): " << std::round(method1) << std::endl;
    std::cout << "round(method2): " << std::round(method2) << std::endl;
    std::cout << "round(method3): " << std::round(method3) << std::endl;
    
    return 0;
}

